package com.boco.blch.runner.result;

/**
 * ResultInfo的实现类，封装了回显消息的三个基本属性:
 * 
 * isSuccess: 此条指令是否执行成功
 * message: 成功时的回显消息；失败时的错误消息
 * code: 指令回显代码。成功时默认为0
 * 
 * @author akira
 *
 */
public class ResultInfo implements Result{
	private boolean isSuccess;
	private String message;
	private int code;
	public ResultInfo(){
		this(true, 0, "");
	}
	public ResultInfo(boolean isSuccess, int code, String detail){
		this.isSuccess = isSuccess;
		this.code = code;
		this.message = detail;
	}
	public void setSuccess(boolean isSuccess) {
		this.isSuccess = isSuccess;
	}
	public void setMessage(String detail) {
		this.message = detail;
	}
	public void setCode(int code) {
		this.code = code;
	}
	@Override
	public boolean isSuccess() {
		return isSuccess;
	}
	@Override
	public String getMessage() {
		return message;
	}
	@Override
	public int getCode() {
		return code;
	}
	
}
